/*
day406_2 
2020.10.7 
*/ 

#include<iostream>
#include<vector>
#include<string>
using namespace std;


class Solution {
public:
    vector<string> summaryRanges(vector<int>& nums) {
    	vector<string> res;
		int start=0,end=1;
		while(start<nums.size())
		{
			end=start+1;
			while(end<nums.size() && nums[end]==nums[end-1]+1)
			{
				++end;
			}
			if(end==start+1)
			{
				res.push_back(to_string(nums[start]));
			 } 
			 else
			 {
			 	string tem=""+to_string(nums[start])+string("->")+to_string(nums[end-1]);
				res.push_back(tem);
			 }
			
			start=end;
		}
		
		return res;
    }
};



int main()
{
	cout<<""+1+string("")+to_string(1)+"->"<<endl;
	return 0;
}
